$(CC) \
$$(otool -l $@ | bin/mac_arm_relink ps=$(SEGMENT_ALIGNMENT_BITS) base=$(TEXT_BASE)) \
$(AM_LDFLAGS) -rdynamic $(LDFLAGS) -o $@ $(FF) $< $(LF) $(LIBS) && \
- ("$$(printf '%s\n1167\n' $$(ld -v 2>&1 | head -n 1 | awk '{print $$2}' | cut -f2 -d: | cut -d- -f2 | cut -d\. -f1) | sort -V |head -n 1)" != "1167" || \
- ( printf '\x00\x00\x00\x00\x01\x00\x00\x00' | dd of=$@ bs=1 seek=64 conv=notrunc && \
+ ( LV=$$(ld -v 2>&1 | head -n 1 | awk '{print $$2}' | cut -f2 -d: | cut -d- -f2 | cut -d\. -f1); \
+ echo "Linker version $$LV" ; \
+ [ "$$(printf '%s\n1167\n' $$LV | sort -r -V |head -n 1)" != "1167" ] || \
+ ( echo "Patching" ; \
+ printf '\x00\x00\x00\x00\x01\x00\x00\x00' | dd of=$@ bs=1 seek=64 conv=notrunc && \
codesign -s - --force $@ )))
unixport/gcl_cmpnopt_gcl_gprof.lsp unixport/gcl_cmpnopt_ansi_gcl_gprof.lsp:\
$(CC) \
$$(otool -l $@ | bin/mac_arm_relink ps=$(SEGMENT_ALIGNMENT_BITS) base=$(TEXT_BASE)) \
$(AM_LDFLAGS) -rdynamic $(LDFLAGS) -o $@ $(FF) $< $(LF) $(LIBS) && \
- ("$$(printf '%s\n1167\n' $$(ld -v 2>&1 | head -n 1 | awk '{print $$2}' | cut -f2 -d: | cut -d- -f2 | cut -d\. -f1) | sort -V |head -n 1)" != "1167" || \
- ( printf '\x00\x00\x00\x00\x01\x00\x00\x00' | dd of=$@ bs=1 seek=64 conv=notrunc && \
+ ( LV=$$(ld -v 2>&1 | head -n 1 | awk '{print $$2}' | cut -f2 -d: | cut -d- -f2 | cut -d\. -f1); \
+ echo "Linker version $$LV" ; \
+ [ "$$(printf '%s\n1167\n' $$LV | sort -r -V |head -n 1)" != "1167" ] || \
+ ( echo "Patching" ; \
+ printf '\x00\x00\x00\x00\x01\x00\x00\x00' | dd of=$@ bs=1 seek=64 conv=notrunc && \
codesign -s - --force $@ )))
unixport/gcl_cmpnopt_gcl_gprof.lsp unixport/gcl_cmpnopt_ansi_gcl_gprof.lsp:\
cadddr cdaddr cddadr cdddar cddddr logand lognot logior logxor c-type complex-real
complex-imag ratio-numerator ratio-denominator cnum-type si::number-plus si::number-minus
si::number-times si::number-divide ;FIXME more
+ si::expand-deftype
,@(mapcar (lambda (x) (cdr x)) (remove-if-not (lambda (x) (symbolp (cdr x))) +cmp-type-alist+))))
(si::putprop l t 'c1no-side-effects))
(get 'truncate 'inline-always))
(push '((fixnum) (returns-exactly fixnum fixnum) #.(flags rfa)"({fixnum _t=(#0);@1(#0)-_t@ _t;})")
(get 'truncate 'inline-always))
-(push '((short-float) (returns-exactly fixnum short-float) #.(flags rfa)"({float _t=(#0);@1(#0)-_t@ _t;})")
+(push '((short-float) (returns-exactly fixnum short-float) #.(flags rfa)"({fixnum _t=(#0);@1(#0)-_t@ _t;})")
(get 'truncate 'inline-always))
-(push '((long-float) (returns-exactly fixnum long-float) #.(flags rfa)"({double _t=(#0);@1(#0)-_t@ _t;})")
+(push '((long-float) (returns-exactly fixnum long-float) #.(flags rfa)"({fixnum _t=(#0);@1(#0)-_t@ _t;})")
(get 'truncate 'inline-always))
;;COMPLEXP
libboot="no"
fi
+case $use in
+ *86*gnu) libboot="no";;
+esac
+
if test "$libboot" = "yes"; then
AMM_LIBBOOT_TRUE=
-fno-PIE -fno-pie -fno-PIC -fno-pic \
-Wall \
-Wno-builtin-requires-header -Wno-empty-body -Wno-self-assign \
- -Wno-unused-but-set-variable -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64 \
+ -Wno-unused-but-set-variable -Wno-tautological-compare \
+ -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64 \
-fbracket-depth=512
add_args_to_ldflags -no-pie -Wl,-z,relro # -Wl,-z,lazy
case $use in
- sh4*) ;; #FIXME, these exceptions needed as of gcc 4.7
- hppa*) ;; #FIXME
- powerpc*) ;; #FIXME
- alpha*) ;; #FIXME
+# sh4*) ;; #FIXME, these exceptions needed as of gcc 4.7
+# hppa*) ;; #FIXME
+# powerpc*) ;; #FIXME
+# alpha*) ;; #FIXME
ia64*) ;; #FIXME
*)
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking __builtin___clear_cache" >&5
main (void)
{
- void *v,*ve;
- __builtin___clear_cache(v,ve);
+ char v[1<<12];
+ __builtin___clear_cache(v,v+sizeof(v));
;
return 0;
AC_SUBST(LF)
libboot="no"
fi
+case $use in
+ *86*gnu) libboot="no";;
+esac
+
AM_CONDITIONAL([AMM_LIBBOOT],[test "$libboot" = "yes"])
if test "$libboot" = "yes" ; then
-fno-PIE -fno-pie -fno-PIC -fno-pic \
-Wall \
-Wno-builtin-requires-header -Wno-empty-body -Wno-self-assign \
- -Wno-unused-but-set-variable -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64 \
+ -Wno-unused-but-set-variable -Wno-tautological-compare \
+ -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64 \
-fbracket-depth=512
add_args_to_ldflags -no-pie -Wl,-z,relro # -Wl,-z,lazy
case $use in
- sh4*) ;; #FIXME, these exceptions needed as of gcc 4.7
- hppa*) ;; #FIXME
- powerpc*) ;; #FIXME
- alpha*) ;; #FIXME
+# sh4*) ;; #FIXME, these exceptions needed as of gcc 4.7
+# hppa*) ;; #FIXME
+# powerpc*) ;; #FIXME
+# alpha*) ;; #FIXME
ia64*) ;; #FIXME
*)
- AC_MSG_CHECKING(__builtin___clear_cache)
+ AC_MSG_CHECKING([__builtin___clear_cache])
AC_RUN_IFELSE(
[AC_LANG_PROGRAM(
[[]],
[[
- void *v,*ve;
- __builtin___clear_cache(v,ve);
+ char v[1<<12];
+ __builtin___clear_cache(v,v+sizeof(v));
]])],
[AC_DEFINE(HAVE_BUILTIN_CLEAR_CACHE,1,[have __builtin__clear_cache instruction])
AC_MSG_RESULT(yes)],
-"Version_2_7_2pre23"
+"Version_2_7_2pre24"
#define SGC
#define STATIC_FUNCTION_POINTERS
-#ifdef IN_SFASL
-#include <sys/mman.h>
-#define CLEAR_CACHE_LINE_SIZE 32
-#define CLEAR_CACHE {\
- void *v1=memory->cfd.cfd_start,*v,*ve=v1+memory->cfd.cfd_size; \
- v1=(void *)((unsigned long)v1 & ~(CLEAR_CACHE_LINE_SIZE - 1));\
- for (v=v1;v<ve;v+=CLEAR_CACHE_LINE_SIZE) asm __volatile__ ("fdc 0(%0)" : : "r" (v) : "memory");\
- asm __volatile__ ("syncdma\n\tsync" : : "r" (v) : "memory");\
- for (v=v1;v<ve;v+=CLEAR_CACHE_LINE_SIZE) asm __volatile__ ("fic 0(%%sr4,%0)" : : "r" (v) : "memory");\
- asm __volatile__ ("syncdma\n\tsync" : : "r" (v) : "memory");}
-#endif
+/* #ifdef IN_SFASL */
+/* #include <sys/mman.h> */
+/* #define CLEAR_CACHE_LINE_SIZE 32 */
+/* #define CLEAR_CACHE {\ */
+/* void *v1=memory->cfd.cfd_start,*v,*ve=v1+memory->cfd.cfd_size; \ */
+/* v1=(void *)((unsigned long)v1 & ~(CLEAR_CACHE_LINE_SIZE - 1));\ */
+/* for (v=v1;v<ve;v+=CLEAR_CACHE_LINE_SIZE) asm __volatile__ ("fdc 0(%0)" : : "r" (v) : "memory");\ */
+/* asm __volatile__ ("syncdma\n\tsync" : : "r" (v) : "memory");\ */
+/* for (v=v1;v<ve;v+=CLEAR_CACHE_LINE_SIZE) asm __volatile__ ("fic 0(%%sr4,%0)" : : "r" (v) : "memory");\ */
+/* asm __volatile__ ("syncdma\n\tsync" : : "r" (v) : "memory");} */
+/* #endif */
#define RELOC_H "elf32_hppa_reloc.h"
#define SPECIAL_RELOC_H "elf32_hppa_reloc_special.h"
#define M68K
/* #define SGC *//*FIXME: Unknown m68k cpu in modern emulators*/
-#include <asm/cachectl.h>
-int cacheflush(void *,int,int,int);
-#define CLEAR_CACHE_LINE_SIZE 32
-#define CLEAR_CACHE do {void *v=memory->cfd.cfd_start,*ve=v+memory->cfd.cfd_size; \
- v=(void *)((unsigned long)v & ~(CLEAR_CACHE_LINE_SIZE - 1));\
- cacheflush(v,FLUSH_SCOPE_PAGE,FLUSH_CACHE_BOTH,ve-v);\
- } while(0)
+/* #include <asm/cachectl.h> */
+/* int cacheflush(void *,int,int,int); */
+/* #define CLEAR_CACHE_LINE_SIZE 32 */
+/* #define CLEAR_CACHE do {void *v=memory->cfd.cfd_start,*ve=v+memory->cfd.cfd_size; \ */
+/* v=(void *)((unsigned long)v & ~(CLEAR_CACHE_LINE_SIZE - 1));\ */
+/* cacheflush(v,FLUSH_SCOPE_PAGE,FLUSH_CACHE_BOTH,ve-v);\ */
+/* } while(0) */
#define C_GC_OFFSET 2
addend=0;
a&=0xfff;
a>>=(((*q)>>29)&0x1)* /*not add/sub*/
- ((((*q)>>26)&0x1) ? /*simd*/
- ((((*q)>>22)&0x3) ?
- (((*q)>>22)&0x3)+1 : (((*q)>>30)&0x1)) :
- (((*q)>>30)&0x3)); /*gp*/
+ (((((*q)>>26)&0x1)&&
+ (((*q)>>22)&0x1)&&
+ (!(((*q)>>30)&0x3))) ? /*simd hardcode*/
+ 4 : (((*q)>>30)&0x3)); /*gp*/
store_val(q,MASK(12) << 10, a << 10);
break;
case ARM64_RELOC_UNSIGNED:
#define SGC
-#define CLEAR_CACHE_LINE_SIZE 32
-#define CLEAR_CACHE do {void *v=memory->cfd.cfd_start,*ve=v+memory->cfd.cfd_size; \
- v=(void *)((unsigned long)v & ~(CLEAR_CACHE_LINE_SIZE - 1));\
- for (;v<ve;v+=CLEAR_CACHE_LINE_SIZE) \
- asm __volatile__ ("dcbst 0,%0\n\tsync\n\ticbi 0,%0\n\tsync\n\tisync": : "r" (v) : "memory");\
- } while(0)
+/* #define CLEAR_CACHE_LINE_SIZE 32 */
+/* #define CLEAR_CACHE do {void *v=memory->cfd.cfd_start,*ve=v+memory->cfd.cfd_size; \ */
+/* v=(void *)((unsigned long)v & ~(CLEAR_CACHE_LINE_SIZE - 1));\ */
+/* for (;v<ve;v+=CLEAR_CACHE_LINE_SIZE) \ */
+/* asm __volatile__ ("dcbst 0,%0\n\tsync\n\ticbi 0,%0\n\tsync\n\tisync": : "r" (v) : "memory");\ */
+/* } while(0) */
#if SIZEOF_LONG == 4
#define RELOC_H "elf32_ppc_reloc.h"
#define SGC
-#ifdef IN_SFASL
-#include <sys/mman.h>
-#define CLEAR_CACHE {\
- void *p=memory->cfd.cfd_start,*pe=p+memory->cfd.cfd_size; \
- p=(void *)((unsigned long)p & ~(PAGESIZE-1)); \
- for (;p<pe;p++) /*+=PAGESIZE?*/ asm __volatile__ ("ocbp @%0\n\t": : "r" (p) : "memory");\
-}
-#endif
+/* #ifdef IN_SFASL */
+/* #include <sys/mman.h> */
+/* #define CLEAR_CACHE {\ */
+/* void *p=memory->cfd.cfd_start,*pe=p+memory->cfd.cfd_size; \ */
+/* p=(void *)((unsigned long)p & ~(PAGESIZE-1)); \ */
+/* for (;p<pe;p++) /\*+=PAGESIZE?*\/ asm __volatile__ ("ocbp @%0\n\t": : "r" (p) : "memory");\ */
+/* } */
+/* #endif */
#define RELOC_H "elf32_sh4_reloc.h"
#define NEED_STACK_CHK_GUARD
(unless tzp (> dstp 0))
(if tzp tz (+ (truncate (- off) 3600) dstp))))))
-(defun encode-universal-time (s n h d m y &optional (tz (this-tz) tzp))
+(defun encode-universal-time (s n h d m y &optional (tz (this-tz) tzp)
+ &aux (tzo (* (- tz (this-tz)) 3600)))
(declare (optimize (safety 2)))
(check-type s (integer 0 59))
(check-type n (integer 0 59))
(check-type h (integer 0 23))
(check-type d (integer 1 31))
(check-type m (integer 1 12))
- (check-type y integer)
+ (check-type y (integer 1899))
(check-type tz rational)
- (+ (mktime s n h d (1- m) (- y 1900) (if tzp 0 -1)) +secs-to-1970+ (* (- tz (this-tz)) 3600)))
+ (cond ((eql 1899 y)
+ (assert (and (eql h 23) (eql d 31) (eql m 12)))
+ (+ s (* n 60) tzo))
+ ((+ (mktime s n h d (1- m) (- y 1900) (if tzp 0 -1)) +secs-to-1970+ tzo))))
(defun get-decoded-time ()
(decode-universal-time (get-universal-time)))
ufixnum k;
for (p=pagetochar(page(v)),k=0;k<tm->tm_nppage;k++,p+=tm->tm_size) {
object o=p;
- if (!is_free(o) && type_of(o)==t_cfdata && (void *)o->cfd.cfd_start>=data_start)
+ if (!is_free(o) && type_of(o)==t_cfdata && !o->d.tt && (void *)o->cfd.cfd_start>=data_start)
gcl_mprotect((void *)o->cfd.cfd_start,o->cfd.cfd_nexp<<PAGEWIDTH,PROT_READ|PROT_EXEC);
}
}
recursive_malloc=1;
gcl_init_alloc(&size);
recursive_malloc=0;
- }
+ } else
+ /*FIXME idempotent but required gcl_init_alloc functions in saved images*/
+#ifdef INITIALIZE_BRK
+ INITIALIZE_BRK;
+#endif
+
CHECK_INTERRUPT;
fas=0;
else if (u.f.va &&(nfargs<fun->fun.fun_minarg || nfargs>fun->fun.fun_maxarg))/*u.f.va -> varg, xxx*/
fas=0;
- else if (u.f.va && VFUN_NARGS<0 && fun->fun.fun_minarg==fun->fun.fun_maxarg)/*runtime apply #arg checking omitted in reg fns*/
+ else if (u.f.va && /* VFUN_NARGS<0 && */fun->fun.fun_minarg==fun->fun.fun_maxarg)/*runtime apply #arg checking omitted in reg fns*/
fas=0;
/* else if (u.f.va && VFUN_NARGS<0 && */
/* (nargs-1<fun->fun.fun_minarg || nargs-1>fun->fun.fun_maxarg))/\*u.f.va -> varg, xxx*\/ */
massert(!un_mmap(st,est));
-#ifdef CLEAR_CACHE
+#if defined(CLEAR_CACHE)
CLEAR_CACHE;
+#elif defined(HAVE_BUILTIN_CLEAR_CACHE)
+ __builtin___clear_cache((void *)memory->cfd.cfd_start,(void *)memory->cfd.cfd_start+memory->cfd.cfd_size);
+#else
+ #error "No clear cache"
#endif
if(symbol_value(sLAload_verboseA)!=Cnil) {
massert(!clear_protect_memory(memory));
-#if defined(HAVE_BUILTIN_CLEAR_CACHE)
- __builtin___clear_cache((void *)memory->cfd.cfd_start,(void *)memory->cfd.cfd_start+memory->cfd.cfd_size);
-#elif defined(CLEAR_CACHE)
+#if defined(CLEAR_CACHE)
CLEAR_CACHE;
+#elif defined(HAVE_BUILTIN_CLEAR_CACHE)
+ __builtin___clear_cache((void *)memory->cfd.cfd_start,(void *)memory->cfd.cfd_start+memory->cfd.cfd_size);
+#else
+ #error "No clear cache"
#endif
if(symbol_value(sLAload_verboseA)!=Cnil) {
#define LOAD_SEC(sec) ({ul _fl=sec->flags&SECTION_TYPE;\
(_fl<=S_SYMBOL_STUBS || _fl==S_16BYTE_LITERALS) && _fl!=S_ZEROFILL && !(sec->flags&S_ATTR_DEBUG);})
+#define GCL_EXTERNAL(sym) ((sym)->n_type & N_EXT || \
+ (((sym)->n_type & N_TYPE) == N_SECT && \
+ (sym)->n_sect == 1 && \
+ !memcmp(strtab+(sym)->n_un.n_strx,"___",3)))
#define MASK(n) (~(~0ULL << (n)))
for (a=c_table.ptable,sym=sym1;sym<syme;sym++) {
- if ((sym->n_type & N_STAB) || !(sym->n_type & N_EXT))
+ if ((sym->n_type & N_STAB) || !GCL_EXTERNAL(sym))
continue;
a->address=sym->n_value;
for (c_table.local_ptable=a,sym=sym1;sym<syme;sym++) {
- if ((sym->n_type & N_STAB) || sym->n_type & N_EXT)
+ if ((sym->n_type & N_STAB) || GCL_EXTERNAL(sym))
continue;
a->address=sym->n_value;
massert(!clear_protect_memory(memory));
-#if defined(HAVE_BUILTIN_CLEAR_CACHE)
- __builtin___clear_cache((void *)memory->cfd.cfd_start,(void *)memory->cfd.cfd_start+memory->cfd.cfd_size);
-#elif defined(CLEAR_CACHE)
+#if defined(CLEAR_CACHE)
CLEAR_CACHE;
+#elif defined(HAVE_BUILTIN_CLEAR_CACHE)
+ __builtin___clear_cache((void *)memory->cfd.cfd_start,(void *)memory->cfd.cfd_start+memory->cfd.cfd_size);
+#else
+ #error "No clear cache"
#endif
massert(!un_mmap(v1,ve));